Skip to main content

trim

Pagpapaliwanag

trim method ay aalisin niyalang yung mga spaces sa unahan at hulihan ng string.

Spaces like '\n' and '\t' included sila

const x = "    hello    ";
console.log(x.length); // 13

//Return Value
console.log(x.trimStart()); // hello
console.log(x.trimStart().length); // 5

Iba pang resources